<?php
/* @var $this PageController */
/* @var $model Article */
/* @var $form CActiveForm */
?>

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'article-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
    'htmlOptions'=>array('class'=>'form-horizontal', 'enctype'=>'multipart/form-data'),
	'enableAjaxValidation'=>false,
)); ?>
<?php //var_dump($model->articleTags);?>
	<?php echo $form->errorSummary($model); ?>
    <input type="hidden" class="form-control" name="Article[type]" id="Article_type" value="2">
    <div class="col-md-7">
        <div class="form-group">
            <?php echo $form->labelEx($model,'title',array('class'=>'col-sm-2 control-label')); ?>
            <div class="col-sm-10">
                <?php echo $form->textField($model,'title',array('size'=>11,'maxlength'=>11,'class'=>'form-control')); ?>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label required" for="Article_sub_title">单页地址 <span class="required">*</span></label>
            <div class="col-sm-10">
                <?php echo $form->textField($model,'sub_title',array('size'=>11,'maxlength'=>11,'class'=>'form-control')); ?>
            </div>
        </div>

        <div class="form-group">
            <?php echo $form->labelEx($model,'summary',array('class'=>'col-sm-2 control-label')); ?>
            <div class="col-sm-10">
                <?php echo $form ->textArea( $model , 'summary' ,array('class'=>'form-control'));?>
            </div>
        </div>
<!--        <div class="form-group">-->
<!--            <label class="col-sm-2 control-label">缩微图</label>-->
<!--            <div class="col-sm-10">-->
<!--                --><?php //echo $form->fileField($model,'thumb',array('size'=>60,'maxlength'=>255,'class'=>'form-control')); ?>
<!--            </div>-->
<!--        </div>-->
        <div class="form-group">
            <?php echo $form->labelEx($model,'content',array('class'=>'col-sm-2 control-label')); ?>
            <div class="col-sm-10">
                <?php
                $this->widget('ext.ueditor.UeditorWidget',
                    array(
                        'model' => $model,
                        'attribute' => 'content',
                        'config'=>array(
                            'serverUrl' => Yii::app()->createUrl('backend/editor/index'),//指定serverUrl
                            'toolbars'=>array(
                                //array('source','link','bold','italic','underline','forecolor','superscript','insertimage','spechars','blockquote')
                            ),
                            'initialFrameHeight'=>'350',
                            'initialFrameWidth'=>'100%'
                        ),
                        'htmlOptions' => array('rows'=>3,'class'=>'')
                    )
                );
                ?>
            </div>
        </div>
    </div>
    <div class="col-md-5">
        <div class="form-group">
            <?php echo $form->labelEx($model,'seo_title',array('class'=>'col-sm-2 control-label')); ?>
            <div class="col-sm-10">
                <?php echo $form ->textField( $model , 'seo_title', array('class'=>'form-control'));?>
            </div>
        </div>
        <div class="form-group">
            <?php echo $form->labelEx($model,'seo_keywords',array('class'=>'col-sm-2 control-label')); ?>
            <div class="col-sm-10">
                <?php echo $form ->textField( $model , 'seo_keywords', array('class'=>'form-control'));?>
            </div>
        </div>
        <div class="form-group">
            <?php echo $form->labelEx($model,'seo_description',array('class'=>'col-sm-2 control-label')); ?>
            <div class="col-sm-10">
                <?php echo $form ->textField( $model , 'seo_description', array('class'=>'form-control'));?>
            </div>
        </div>
        <div class="form-group">
            <div class="col-xs-4">
                <?php echo $form->labelEx($model,'status',array('class'=>'col-sm-2 control-label')); ?>
                <div class="col-sm-8">
                    <?php echo $form ->dropDownList($model, 'status' ,array('1'=>'发布' , '0'=>'草稿' ), array('class'=>'form-control'));?>
                </div>
            </div>
            <div class="col-xs-4">
                <label class="col-sm-4 control-label">评论</label>
                <div class="col-sm-8">
                    <?php echo $form ->dropDownList($model, 'can_comment' ,array('1'=>'是' , '0'=>'否' ), array('class'=>'form-control'));?>
                </div>
            </div>
            <div class="col-xs-4">
                <label class="col-sm-4 control-label">可见</label>
                <div class="col-sm-8">
                    <?php echo $form ->dropDownList($model, 'visibility' ,array('1'=>'公开', '2'=>'回复', '3'=>'密码', '4'=>'登录'), array('class'=>'form-control'));?>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">标签</label>
            <div class="col-sm-10">
                <?php echo $form ->textField( $model , 'tag', array('class'=>'form-control'));?>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">排序</label>
            <div class="col-sm-10">
                <?php echo $form ->textField( $model , 'sort', array('class'=>'form-control'));?>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">模板</label>
            <div class="col-sm-10">
                <?php echo $form ->textField($model, 'template', array('class'=>'form-control'));?>
            </div>
        </div>
        <div class="hr hr-18 dotted"></div>
        <div class="clearfix">
            <div class="col-md-offset-2 col-md-10">
                <button class="btn btn-white btn-info btn-round" type="submit"><i class="ace-icon fa fa-floppy-o bigger-120 blue"></i>保存</button>
                &nbsp;
                <button class="btn btn-white btn-default btn-round" type="reset"><i class="ace-icon fa fa-times red2"></i>取消</button>
            </div>
        </div>
    </div>

<?php $this->endWidget(); ?>
